package com.donkeyx.pattern.factory.simplefactory;

import com.donkeyx.pattern.factory.Circular;
import com.donkeyx.pattern.factory.Graphical;
import com.donkeyx.pattern.factory.Triangle;

public class GraphicalFactory {


    public static Graphical createGraphical(String type) throws UnSupportedShapeException {

        if("三角形".equals(type)){
            return new Triangle();
        }else if("圆形".equals(type)){
            return new Circular();
        }else{
            throw new UnSupportedShapeException();
        }
    }
}
